﻿using System;
using System.Linq;
using DTOSW.Core.Membership.Objects.Model;

namespace DTOSW.Core.Membership.Extensions
{
    public static class UserExtension
    {
        public static User WithUserID(this IQueryable<User> query, Guid UserID)
        {
            return (from user in query
                    where user.UserID == UserID
                    select user).SingleOrDefault();
        }
        public static User WithUserName(this IQueryable<User> query, string UserName)
        {
            return (from user in query
                    where user.UserName == UserName
                    select user).SingleOrDefault();
        }
        public static User WithFullName(this IQueryable<User> query, string FirstName, string LastName)
        {
            return (from user in query
                    where (user.Profile.FirstName == FirstName && user.Profile.LastName == LastName)
                    select user).SingleOrDefault();
        }
        public static void asd(this User query, string FirstName, string LastName)
        {
            return;
        }
    }
}
